package com.sl.au;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;

import com.sl.au.entity.StorageProperties;
import com.sl.au.service.AttachmentService;

@SpringBootApplication
@EnableConfigurationProperties(StorageProperties.class)
@EnableScheduling
public class WCSIApplication {
	private static Logger logger = LoggerFactory.getLogger(WCSIApplication.class);

	public static void main(String[] args) {
		SpringApplication.run(WCSIApplication.class, args);
		logger.info("启动成功....");
	}
	/**
	 * 初始化1
	 * 
	 * @param storageService
	 * @return
	 */
	@Bean
	CommandLineRunner init(AttachmentService attachmentService) {
		return (args) -> {
			// 初始化文件存储目录1
			// storageService.deleteAll();
			attachmentService.init();

		};
	}
}
